var _mm=require('common/util/mm.js');



var _cart={
	
	//获取购物车数量
	getCartCount:function(resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/cart/get_cart_product_count.do'),
			method :'POST',
			success:resolve,
			error  :reject,

		})
	},
	getCartList:function(resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/cart/list.do'),
			method :'POST',
			success:resolve,
			error  :reject,

		})
	},
	addProduct:function(productInfo,resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/cart/add.do'),
			data:productInfo,
			method :'POST',
			success:resolve,
			error  :reject,

		})
	},
	//选中购物车商品

	selectProduct:function(idInfo,resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/cart/select.do'),
			data   :idInfo,
			method :'POST',
			success:resolve,
			error  :reject,

		})
	},
//取消选中商品
	unselectProduct:function(idInfo,resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/cart/un_select.do'),
			data   :idInfo,
			method :'POST',
			success:resolve,
			error  :reject,

		})
	},
//选中全部商品
	selectAllProduct:function(resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/cart/select_all.do'),
		
			method :'POST',
			success:resolve,
			error  :reject,

		})
	},	
//取消全部选中
	unselectAllProduct:function(resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/cart/un_select_all.do'),
		
			method :'POST',
			success:resolve,
			error  :reject,

		})
	},
updateProduct:function(productInfo,resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/cart/update.do'),
			data:productInfo,
			method :'POST',
			success:resolve,
			error  :reject,

		})
	},
deleteSelectProduct:function(idInfo,resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/cart/delete_product.do'),
			data:idInfo,
			method :'POST',
			success:resolve,
			error  :reject,

		})
	},
	


	
}
module.exports =_cart;